#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
    int n; cin >> n;
    vector<int> arr(n);
    for (auto& e : arr) cin >> e;
    n = unique(arr.begin(), arr.end()) - arr.begin();
    for (int i = 0; i < n; i++)
    {
        if (i) cout << ' ';
        cout << arr[i];
    }
    return 0;
}